/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package engine;

/**
 *
 * @author Yole
 */

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import graphics.player.SpaceShip;

public class KeyControls extends KeyAdapter {

    SpaceShip sship;

    public KeyControls( SpaceShip s ){ sship = s; }
    
    @Override
    public void keyPressed( KeyEvent e ) {

        if ( e.getKeyCode() == 65 ) {
            System.out.print("A.");
            sship.moveHoriz(-10);
        }
        if ( e.getKeyCode() == 68 ){
            System.out.print("D.");
            sship.moveHoriz(10);
        }
        if ( e.getKeyCode() == 83 ){
            System.out.print("S.");
            sship.moveVert(10);
        }
        if ( e.getKeyCode() == 87 ){
            System.out.print("W.");
            sship.moveVert(-10);
        }


    }

}
